package cn.edu.tju.elm.mapper;

import cn.edu.tju.elm.dto.AddressResponseDTO;
import cn.edu.tju.elm.model.DeliveryAddress;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * ClassName: AddressMapper
 * Package: cn.edu.tju.elm.mapper
 * Description: 地址实体和DTO转换器
 *
 * @Author Niu Wenhang
 * @Create 2025/9/20 12:00
 * @Version 1.0
 */
@Mapper(componentModel = "spring")
public interface AddressMapper {

    @Mapping(source = "customer.id", target = "customerId")
    AddressResponseDTO addressToResponseDTO(DeliveryAddress address);

    List<AddressResponseDTO> addressesToResponseDTOs(List<DeliveryAddress> addresses);
}
